module.exports = (app)=> {
  const DataTypes = app.Sequelize;
  return app.model.define('t_historywarn', {
    hw_index: {
      autoIncrement: true,
      type: DataTypes.INTEGER,
      allowNull: false,
      primaryKey: true
    },
    pdi_index: {
      type: DataTypes.INTEGER.UNSIGNED,
      allowNull: false,
      defaultValue: 0
    },
    wd_index: {
      type: DataTypes.INTEGER,
      allowNull: false,
      defaultValue: 0
    },
    rs_updatetime: {
      type: DataTypes.DATE,
      allowNull: false
    },
    Rs_status: {
      type: DataTypes.TINYINT,
      allowNull: false,
      defaultValue: 0
    },
    hw_descrition: {
      type: DataTypes.TEXT,
      allowNull: true
    },
    pdi_name: {
      type: DataTypes.STRING(64),
      allowNull: false,
      defaultValue: ""
    },
    wd_warndesc: {
      type: DataTypes.STRING(100),
      allowNull: false,
      defaultValue: ""
    },
    Wc_classname: {
      type: DataTypes.STRING(100),
      allowNull: false,
      defaultValue: ""
    },
    dt_typememo: {
      type: DataTypes.STRING(64),
      allowNull: false,
      defaultValue: ""
    },
    Co_ID: {
      type: DataTypes.INTEGER,
      allowNull: false
    },
    pdi_code: {
      type: DataTypes.INTEGER,
      allowNull: false
    },
    Fid: {
      type: DataTypes.INTEGER,
      allowNull: false
    },
    AreaName: {
      type: DataTypes.STRING(100),
      allowNull: false,
      defaultValue: ""
    },
    oper_status: {
      type: DataTypes.INTEGER,
      allowNull: true,
      defaultValue: 1
    }
  }, {

    tableName: 't_historywarn',
    timestamps: false,
    underscored: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "hw_index" },
        ]
      },
      {
        name: "hw_index",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "hw_index" },
        ]
      },
    ]
  });
};
